<template>
  <div class="header">
    <van-nav-bar
      :title="$route.meta.title"
      :left-text="$route.meta.LeftText"
      :left-arrow="$route.meta.LeftArrow"
      @click-left="goback"
      :fixed="fixed"
      :placeholder="fixed"
    >
      <template #right v-if="$route.meta.RightText">
        <!-- <van-icon name="search" size="18" /> -->
        <div class="right" @click="showDel" :class="{ style: flag }">管理</div>
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      fixed: true,
      showdel: false,
      flag: false,
    };
  },
  computed: {},
  watch: {},

  methods: {
    //返回上一页
    goback() {
      this.$router.go(-1);
    },
    //点击管理后，显示删除按钮，将this.showdel传递给父组件
    showDel() {
      this.showdel = !this.showdel;
      this.$emit("func", this.showdel);
      this.flag = !this.flag;
    },
  },
  created() {},
  mounted() {},
  components: {},
};
</script>
<style scoped>
.right {
  font-size: 12px;
  width: 38px;
  height: 18px;
  line-height: 18px;
  border-radius: 10px;
  letter-spacing: 1px;
}
.style {
  font-weight: bold;
  border: 1px solid rgb(255, 115, 0);
  color: rgb(255, 38, 0);
  background: rgb(247, 247, 247);
}
</style>
